import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '物料类别编号',
    align:"center",
    dataIndex: 'categoryNo'
   },
   {
    title: '物料类别名称',
    align:"center",
    dataIndex: 'categoryName'
   },
   {
    title: '父物料类型编号',
    align:"center",
    dataIndex: 'typeNo'
   },
   {
    title: '供应商',
    align:"center",
    dataIndex: 'supplierNo'
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unitNo'
   },
   {
    title: '安全库存',
    align:"center",
    dataIndex: 'safetyInventory'
   },
   {
    title: '创建人',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '创建时间',
    align:"center",
    sorter: true,
    dataIndex: 'createTime'
   },
   {
    title: '更新人',
    align:"center",
    dataIndex: 'updateBy'
   },
   {
    title: '更新时间',
    align:"center",
    sorter: true,
    dataIndex: 'updateTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "物料类别编号",
      field: 'categoryNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "物料类别名称",
      field: 'categoryName',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "父物料类型编号",
      field: 'typeNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "供应商",
      field: 'supplierNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "单位",
      field: 'unitNo',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "安全库存",
      field: 'safetyInventory',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "创建人",
      field: 'createBy',
      component: 'Input',
      //colProps: {span: 6},
 	},
     {
      label: "创建时间",
      field: "createTime",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
          showTime:true
      },
      //colProps: {span: 6},
	},
	{
      label: "更新人",
      field: 'updateBy',
      component: 'Input',
      //colProps: {span: 6},
 	},
     {
      label: "更新时间",
      field: "updateTime",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
          showTime:true
      },
      //colProps: {span: 6},
	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '物料类别编号',
    field: 'categoryNo',
    component: 'Input',
  },
  {
    label: '物料类别名称',
    field: 'categoryName',
    component: 'Input',
  },
  {
    label: '父物料类型编号',
    field: 'typeNo',
    component: 'Input',
  },
  {
    label: '供应商',
    field: 'supplierNo',
    component: 'InputNumber',
  },
  {
    label: '单位',
    field: 'unitNo',
    component: 'InputNumber',
  },
  {
    label: '安全库存',
    field: 'safetyInventory',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  categoryNo: {title: '物料类别编号',order: 0,view: 'text', type: 'string',},
  categoryName: {title: '物料类别名称',order: 1,view: 'text', type: 'string',},
  typeNo: {title: '父物料类型编号',order: 2,view: 'text', type: 'string',},
  supplierNo: {title: '供应商',order: 3,view: 'number', type: 'number',},
  unitNo: {title: '单位',order: 4,view: 'number', type: 'number',},
  safetyInventory: {title: '安全库存',order: 5,view: 'number', type: 'number',},
  createBy: {title: '创建人',order: 6,view: 'text', type: 'string',},
  createTime: {title: '创建时间',order: 7,view: 'datetime', type: 'string',},
  updateBy: {title: '更新人',order: 8,view: 'text', type: 'string',},
  updateTime: {title: '更新时间',order: 9,view: 'datetime', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
